starter.controller('designController', ['$rootScope','$state','$ionicHistory','$timeout','$ionicScrollDelegate', '$scope', 'XCode','Page',
    function($rootScope,$state,$ionicHistory,$timeout,$ionicScrollDelegate, $scope, XCode,Page) {

        $scope._pageSize = 10;
        $scope._pageIndex = 0;
        $scope.search = {}

        //定义自动查询
        $scope.autoSearch = {

        }

        $scope.search.queryType = "2";
        $scope.viewCurrent = function(stopInfo) {
            var transParams = {};
            transParams.stopId = stopInfo.stopId;
            transParams.stopName = stopInfo.stopName;
            $state.go("stopMapInfo",{transParams:transParams});
        }

        $scope.changeSearchVal = function(selectVal) {
            Page.ajaxPostQuiet('web/queryBusOrStop.do', {param : selectVal,queryType : $scope.search.queryType,
                _pageSize : $scope._pageSize, _pageIndex : $scope._pageIndex}, function (resp) {
                $scope.stopList = resp.data.rows;
            });
        }

        $scope.viewMediaImg = function(resource) {
            $scope.Url = "http://10.100.235.22/download/image/20161201/04a32bf33922482bbf480c8f234a2076.jpg";                   //$scope定义一个变量Url，这里会在大图出现后再次点击隐藏大图使用
            $scope.bigImage = true;
        }

        $scope.hideBigImage = function () {
            $scope.bigImage = false;
        };
        $scope.indexTitle = "图片浏览";
        $scope.bigImage = false;    //初始默认大图是隐藏的
        $scope.imageIndex = -1;//当前展示的图片

        //点击图片放大
        $scope.shouBigImage = function (imageName, imageIndex) {  //传递一个参数（图片的URl）
            $scope.imageIndex = imageIndex;
            $scope.Url = imageName;                   //$scope定义一个变量Url，这里会在大图出现后再次点击隐藏大图使用
            $scope.bigImage = true;                   //显示大图
        }
    }]);
